package com.md.drcs.dicom.dao;

import com.md.common.utils.dao.MyMapper;
import com.md.drcs.dicom.entity.PatientEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PatientDao extends MyMapper<PatientEntity> {

    @Select("<script>" +
            "select * from t_patient where nPatId in " +
            " <foreach collection='patIds' item='patId' open='(' separator=',' close=')'>" +
            " #{patId}" +
            " </foreach>" +
            "</script>")
    List<PatientEntity> findByIds(@Param("patIds") List<Long> patIds);

    @Select("select * from t_patient where sPatIdInPacs = #{sPatIdInPacs} and sHospid = #{hospId}")
    List<PatientEntity> findByPatIdInPacs(@Param("sPatIdInPacs") String sPatIdInPacs, @Param("hospId") String hospId);
}
